<%@page import="news.Newsdao"%>
<%@page import="news.News"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
     <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="<%=request.getContextPath() %>/js/ckeditor/ckeditor.js"></script>
<title>修改新闻</title>
<style>
*{
	margin:0;
	padding:0;
}
body {
	width：100%;
	height: 100%;
	background-image: url(../images/1.png);
	background-repeat: no-repeat;
	background-size: cover;;
}
table{
	margin:30px 20%;
}
textarea{
	height:8em;
	width:32em;
	resize:none;
}
input[type=text]{
	height:1.5em;
	border:none;
	
}
.ti{
	width:32em;
	border:none;
}
input[type=button]{
	letter-spacing:2em;
	padding:5px 0 5px 2em;
	margin:10px 40%;
}
input[type=submit]{
letter-spacing:2em;
	padding:5px 0 5px 2em;
	margin:10px 40%;
}
.text {
	position: relative;
	
}
.comments {
 width:100%;/*自动适应父布局宽度*/
 overflow:auto;
 word-break:break-all;/*在ie中解决断行问题(防止自动变为在一行显示，主要解决ie兼容问题，ie8中当设宽度为100%时，文本域类容超过一行时，当我们双击文本内容就会自动变为一行显示，所以只能用ie的专有断行属性“word-break或word-wrap”控制其断行)*/
}
</style>
</head>

<body>
<%
 int nid = Integer.parseInt(request.getParameter("nid"));
 Newsdao dao = new Newsdao();
 News news = dao.doNewsQueryById(nid);
%>
<form align="center" action="../ServletNewsModify?nid=<%=nid%>" method="post">
<table>
<tr>
	<td class="text" align="center">新闻标题</td>
	<td colspan="3"><input class="ti" type="text" value="<%=news.getTitle() %>" ></td>
</tr>
<tr>
	<td >发布人</td>
	<td><input type="text" value="<%=news.getUname()%>" readonly="readonly"></td>
	</tr>
	<tr>
	<td class="text">发布时间</td>
	<td><input type="text" value="<fmt:formatDate value="${news.getPubtime()}" pattern="yyyy-MM-dd HH:mm:ss"/>" readonly="readonly"></td>
</tr>
<tr>
	<td class="text" align="center">新闻正文</td>
	<td><textarea   name="content" class="ckeditor" class="comments" rows=1   name=s1   cols=27   onpropertychange= "this.style.posHeight=this.scrollHeight "><%=news.getContent() %></textarea></td>
</tr>

<tr colspan="2" style="background-color:transparent;" align="center" >
    <td><input type="submit" value="修改"></td>
	<td ><input type="button" value="返回" onclick="backQuery()"></td>
</tr>
</table>
</form>
</body>
<script type="text/javascript">
function backQuery(){
	window.location="./news_list.jsp";
}
</script>
</body>
</html>